package top.zhangjianyong.tools.config.json;

import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
import top.zhangjianyong.tools.annotation.RequestMessageType;
import top.zhangjianyong.tools.constant.MessageType;

/**
 * @author zhangjianyong
 * @since 2025/3/19 上午10:08
 */
public class FastJsonHttpMessageConverter2 extends FastJsonHttpMessageConverter {
    @Override
    protected boolean supports(Class<?> clazz) {
        RequestMessageType annotation = clazz.getAnnotation(RequestMessageType.class);
        if (annotation == null)
            return true;
        MessageType value = annotation.value();
        return value == MessageType.JSON;
    }
}
